﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class MenuControl : MonoBehaviour 
{
    public Canvas OptionsMenu;
    public Canvas QuitMenu;
    public Button StartButton;
    public Button OptionsButton;
    public Button ExitButton;

	// Use this for initialization
	void Start () 
    {
        OptionsMenu = OptionsMenu.GetComponent<Canvas>();
        QuitMenu = QuitMenu.GetComponent<Canvas>();
        StartButton = StartButton.GetComponent<Button>();
        OptionsButton = OptionsButton.GetComponent<Button>();
        ExitButton = ExitButton.GetComponent<Button>();

        OptionsMenu.enabled = false;
        QuitMenu.enabled = false;
	}

    public void StartButton_Press()
    {
        Application.LoadLevel(1);
    }

    public void OptionsButton_Press()
    {
        OptionsMenu.enabled = true;
        QuitMenu.enabled = false;
        StartButton.enabled = false;
        OptionsButton.enabled = false;
        ExitButton.enabled = false;
    }

    public void CloseOptionsButton_Press()
    {
        OptionsMenu.enabled = false;
        QuitMenu.enabled = false;
        StartButton.enabled = true;
        OptionsButton.enabled = true;
        ExitButton.enabled = true;
    }
	
	public void ExitButton_Press()
    {
        OptionsMenu.enabled = false;
        QuitMenu.enabled = true;
        StartButton.enabled = false;
        OptionsButton.enabled = false;
        ExitButton.enabled = false;
    }

    public void YesButton_Press()
    {
        Application.Quit();
    }

    public void NoButton_Press()
    {
        OptionsMenu.enabled = false;
        QuitMenu.enabled = false;
        StartButton.enabled = true;
        OptionsButton.enabled = true;
        ExitButton.enabled = true;
    }
}
